s_1 = '1'
s_2 = '2'
s_3 = '3'
s_4 = '4'
s_5 = '5'
with open('test.txt', 'w') as f:
    f.write(s_1 * 20)
    f.write(s_2 * 20)
    f.write(s_3 * 20)
    f.write(s_4 * 20)
    f.write(s_5 * 20)
    f.close()


z = open('test.txt', 'r')

g = z.read(10)#先读取 10 个数
g1 = z.read(40)#接着读取剩下的40个数  就是10 ~ 50 的数
print(g)
print(g1)
sum = 0

for i in g1:
    j = int(i)
    sum += j

print(sum)
